package 如何初始化数组;

import java.util.Arrays;
import java.util.Random;

public class 数组反转16 {
	public static void main(String[] args) {
        Random r = new Random();
        int[] arry = new int[5];
        for (int i = 0; i < 5; i++) {
            arry[i] = r.nextInt(100);
        }
        System.out.println(Arrays.toString(arry));
        for (int i = 0; i < arry.length / 2; i++) {
            int temp;
            temp = arry[i];
            arry[i] = arry[arry.length - 1 - i];
            arry[arry.length - 1 - i] = temp;
        }
        System.out.println(Arrays.toString(arry));
    }
}